<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" aria-labelledby="createOrEditModal" class="modal fade" tabindex="-1"
    role="dialog" aria-hidden="true" [config]="{backdrop: 'static'}">
    <div class="modal-dialog modal-md">
        <div class="modal-content">
            <form #settingForm="ngForm" novalidate name="settingForm" (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span>{{l("appsettingedit")}}</span>
                        <span>&nbsp; id:{{dispatchedId}}</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')">
                        <i aria-hidden="true" class="ki ki-close"></i>
                    </button>
                </div>
                <div class="modal-body">
                    <div class="form-row">
                        <div class="form-group col-12">
                            <label class="control-label">{{l("name")}}</label>
                            <span class="form-control">{{name}}</span>
                        </div>
                        <div class="form-group col-12">
                            <label class="control-label">{{l("Alias")}}</label>
                            <input class="form-control" name="alisas" [(ngModel)]="settings.alias" />
                        </div>
                        <div class="form-group col-12">
                            <label class="control-label">{{l("appsetting")}}</label>
                            <textarea class="form-control" name="extensionData" [(ngModel)]="settings.extensionData">
                            </textarea>
                        </div>
                        <div class="form-group col-12">
                            <label class="control-label">{{l("uploadFilePackage")}}</label>
                            <form name="materialPacketUrlForm" id="materialPacketUrlForm" novalidate>
                                <input [ngStyle]="{'width':settings?.materialPacketUrl?'80%':'90%','float':'left'}" class="form-control" type="text" name="packageUrl"
                                    [(ngModel)]="settings.materialPacketUrl">
                                <label for="file" style="float: right;" class="btn btn-primary fileLabel">
                                    {{settings?.materialPacketUrl?l('Edit'):l('add')}}
                                    <input class="form-control" type="file" id="file" name="fileUrl" multiple="false" (change)="uploadFile($event)">
                                </label>
                                <label *ngIf="settings?.materialPacketUrl" style="margin: 0 5px;float: right;" class="btn btn-primary" (click)="resetResource()">{{l('Delete')}}</label>
                            </form>
                        </div>
                        <div class="form-group col-12">
                            <div class="progress" *ngIf="progress">
                                <div class="progress-bar progress-bar-info progress-bar-striped" role="progressbar" aria-valuenow="20" aria-valuemin="0"
                                    aria-valuemax="100" [ngStyle]="{width: progress+'%'}">
                                    <span class="sr-only">{{progress}}% Complete</span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-12">
                            <label class="checkbox">
                                <input name="isDefault" type="checkbox" [(ngModel)]="settings.isDefault"> {{l('isdefaultstart')}}
                                <span></span>
                            </label>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" (click)="close()">{{l('Close')}}</button>
                    <button type="submit" class="btn btn-primary blue" [disabled]="!settingForm.form.valid" [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')">
                        <i class="fa fa-save"></i>
                        <span>{{l("Save")}}</span>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>
